package com.itheima;

import java.util.Calendar;
import java.util.Date;

/**
 * @author hql
 * @date 2019-12-11 21:14
 */
public class Demo {
    public static void main(String[] args) {
        //获取calendar对象
        Calendar calendar = Calendar.getInstance();
        //获取12个月之前的日期
        calendar.add(Calendar.MONTH,-12);
        Date time = calendar.getTime();
        System.out.println(time);
    }
}
